#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
typedef struct stu
{
	int grade;
	int  number;
	struct stu*next;
}ST;

void PushBack(ST* plist,int num,int x)
{
	ST* newnode = (ST*)malloc(sizeof(ST));
	if (newnode != NULL)
	{
		newnode->next = NULL;
	}
	else
	{
		exit(0);
	}
	ST* tail = plist;
	while (tail->next != NULL)
	{
		tail = tail->next;
	}
	tail->next = newnode;
	newnode->grade = x;
	newnode->number= num;
}
void print(ST*plist)
{
	ST* cur = plist->next;
	while (cur)
	{
		printf("学生的学号%d\n", cur->number);
		printf("学生的成绩%d\n", cur->grade);
		cur = cur->next;
		printf("\n");
	}
}
int main()
{
	int n = 0;
	ST* ImageNode = (ST*)malloc(sizeof(ST));
	if (ImageNode == NULL)
	{
		exit(0);
	}
	else
	{
		ImageNode->grade = -1;
		ImageNode->number = 0;
		ImageNode->next = NULL;
	}
	//ST* head = ImageNode->next;
	srand((unsigned int)time);
	printf("请输入要显示学生的信息个数\n");
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		PushBack(ImageNode,i+1, rand() % (100-60+1)+ 60);
	}
	print(ImageNode);

	return 0;
}